<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	template="/template/main.xhtml">

	<ui:define name="body">
		<h:form>
			
			<p:dataTable id="list" var="bean" value="#{produtoListMB.lazyModel}"
				lazy="true" paginator="true" first="#{messages['page.first']}"
				rows="#{messages['page.rows']}">
				<f:facet name="header">#{messages['produto.list.table.title']}</f:facet>
				

				<p:column sortBy="#{bean.codigo}" width="25%">
					<f:facet name="header">#{messages['produto.label.codigo']}</f:facet>
					<h:commandLink action="#{produtoListMB.getNextView}"
						actionListener="#{produtoListMB.clear}">
						<h:outputText value="#{bean.codigo}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>

				<p:column sortBy="#{bean.nome}" width="*%">
					<f:facet name="header">#{messages['produto.label.nome']}</f:facet>
					<h:commandLink action="#{produtoListMB.getNextView}"
						actionListener="#{produtoListMB.clear}">
						<h:outputText value="#{bean.nome}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>

			</p:dataTable>
		</h:form>

	</ui:define>
</ui:composition>